<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .rolling,
    [data-rolling]{
      line-height: 1em;
      font-size: 30px;
      height: 1em;
      font-weight: bold;
      overflow: hidden;
    }
  </style>
</head>
<body>

<div style="height: 500px"></div>
<div style="text-align: center">
  <div style="display: inline-block;color: red;" data-rolling="2022" ></div>
  <br>
  <div style="display: inline-block;color: red;" data-rolling="2020" ></div>
</div>


<div style="height: 500px"></div>
<div style="text-align: center">
  <div style="display: inline-block;color: red;" id="rolling01" class="rolling"></div>
</div>

<div style="height: 500px"></div>
<div style="text-align: center">
  <div style="display: inline-block;color: red;" data-rolling="CHINA" data-rolling-count="2" data-rolling-duration="5" data-rolling-string="ABCDEFGHIJKLMNOPQRSTUVWXYZ"></div>
</div>
<div style="height: 500px"></div>


<script src="rolling.js"></script>
<script>
  new Rolling({
    el: '[data-rolling]',
  }).init();

  new Rolling({
    el: '#rolling01',
    value: '二零二二',
    string: '零一二三四五六七八九',
    duration: 2,
    count: Infinity,
    callback(el){
      console.log(el);
    }
  }).init();

</script>
</body>
</html>